#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>


void reverse(char* left, char* right)
{
	assert(left && right);
	while (left < right)
	{
		char tmp = 0;
		tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}


void arr_move(char arr[], int k)
{
	int len = strlen(arr);
	k %= len;
	reverse(arr, arr + k - 1);
	reverse(arr + k, arr + len - 1);
	reverse(arr, arr + len - 1);
}


int main()
{
	char arr[] = "asdfghj";
	int k = 0;
	scanf("%d", &k);
	arr_move(arr, k);
	printf("%s", arr);
	return 0;
}